<style>
.fui-list-media img {
    width: 80px;
    height: 80px;
}
.diy-phone .phone-head:before {
    content: "";
    position: absolute;
    top: 15px;
    left: 192px;
    height: 8px;
    width: 8px;
    background: #ddd;
    border-radius: 8px;
}

.diy-phone .phone-head:after {
    content: "";
    position: absolute;
    top: 15px;
    left: 208px;
    height: 8px;
    width: 50px;
    background: #ddd;
    border-radius: 8px;
}
.diy-phone .phone-title {
    height: 76px;
    background: url("../images/top_bg.png") 0 0 no-repeat scroll #333;
    background-size: 100% auto;
    padding: 0 50px;
    font-size: 16px;
    color: #fff;
    text-align: center;
    line-height: 90px;
    cursor: default;
    overflow: hidden;
    display:block;
    white-space:nowrap;
    text-overflow:ellipsis;
}
.fui-list.active{
    border: 2px dashed #00a0e9;
}
</style>
<div class="panel-body">
     <div class="diy-phone" style="height:600px;width:31%;margin:6px;float:left">
				<div class="phone-head"></div>
				<div class="phone-body" style="height:500px">
					<div class="phone-title" style="background: url(../core/resource/images/diy/white.png) center top / 100% no-repeat scroll #4491F1;">订单商品</div>
					<div class="phone-main ui-sortable" id="phone" style="height:446px;background-color: #fff;">
						<div style="height:446px">
							<div class="fui-page fui-page-current" style="width:auto">
								<div ng-if="pagedata.goods.length<=0 && pagedata.loaded" class="content-empty">
									<img src="../addons/jy_weishop/images/nogoods.png" style="width: 6rem;margin-bottom: .5rem;"><br/><p style="color: #999;font-size: .75rem">您的订单中没有商品哦！</p><br/>
								</div>
								<div ng-if="pagedata.goods.length>0" class="fui-list-group" id="container" style="background:none;height:1200px;margin-top:10px;">
									<div ng-repeat="g in pagedata.goods" ng-click="pagedata.nowgoodskey=$index;pagedata.nowgoods=g" ng-class="{'fui-list':1,'active':pagedata.nowgoods.id==g.id}">
										<div class="fui-list-media image-media">
											<a href="javascript:;">
												<img ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}" class="">
											</a>
										</div>
										<div class="fui-list-inner">
												<div class="text bold">
													{{g.title}}
												</div>
												<div style="padding:5px;font-size:15px;line-height:1">
													<div class="choose-option">{{g.optiontitle ||'默认'}}</div>
													<div style="padding:5px 0;">
														<span class="red">￥{{g.price}}</span> x {{g.total}} /{{g.goodsinfo.unit || '件'}} <span ng-if="g.goodsinfo.weight!='0.00'">（{{g.goodsinfo.weight}}kg）</span>
														<span class="red bold r">￥<span class='marketprice' style="font-size:20px">{{g.total_price}}</span></span>
													</div>
													
												</div>
									</div>
								</div>
								</div>		
							</div>
						</div>
					</div>
				</div>
				<div class="phone-foot" style="height:18px;margin:10px auto 5px"></div>
	</div>
	<div class="col-lg-4">
        <style>
            .i-add-btn{
                width:20px;  line-height:20px; text-align:center; border-radius:10px;  font-size:10px;
                background-color:#FE4F4E;
                color: #fff;
            }
            .i-remove-btn{
                border: 1px solid #a7a2a9; width:20px;   line-height:20px; text-align:center;
                border-radius:10px; font-size:10px
            }
        </style>
        <div class="panel panel-default" style="width: 100%;">
			<div class="panel-body form-horizontal ">
						<div class="form-group">
								<div class="col-sm-12">
									<div class="input-group">
									<input type="text" name="offcode" ng-change="pagedata.getgoods()" ng-model="pagedata.offcode" class="form-control" placeholder="请扫描或输入商品称码"/>
									<div class="input-group-btn">
											 <input type="button" value="查询" class="btn" ng-click="pagedata.getgoods()"/>
									 </div>
									</div>
									<div class="help-block">如果是称码商品（并绑定了称码规则的商品），扫码称重条形码，会自动录入当前条形码商品的重量！</div>
								</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
								当前商品
							</label>
							<div class="col-sm-10 col-lg-9">
								<div class="input-group">
								<input type="text" readonly ng-model="pagedata.nowgoods.title" class="form-control" value="" />
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
								商品多少{{pagedata.nowgoods.goodsinfo.unit}}
							</label>
							<div class="col-sm-10 col-lg-9">
								<div class="input-group">
								<input type="text" ng-change="pagedata.upprice()" ng-model="pagedata.nowgoods.total" class="form-control" value="" />
								<span class="input-group-addon">{{pagedata.nowgoods.goodsinfo.unit}}</span>
								</div>
								<div class="help-block">也可以手动修改商品重量或件数，价格会时时更新！</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
								商品单价
							</label>
							<div class="col-sm-10 col-lg-9">
								<div class="input-group">
								<input type="text" readonly ng-model="pagedata.nowgoods.price" class="form-control" value="" />
								<span class="input-group-addon">/{{pagedata.nowgoods.goodsinfo.unit}}</span>
								</div>
							</div>
						</div>
			 </div>
        </div>
        <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="row-fluid">
                        <div class="span3 control-group">
                            订单信息
                        </div>
                    </div>
                </div>
                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 col-lg-3 control-label">订单类型</label>
                        <div class="col-sm-10 col-lg-9">
                            <select class="form-control" ng-model="pagedata.order.sendtype" readonly>
                                <option ng-selected="pagedata.order.sendtype==2" value="2" >自提/店内</option>
								<option ng-selected="pagedata.order.sendtype==1" value="1" >快递配送</option>
								<option ng-selected="pagedata.order.sendtype==3" value="3" >虚拟商品</option>
							</select>
                        </div>
                    </div>
					 <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
                            手机号码</label>
                        <div class="col-sm-10 col-lg-9">
							<div class="input-group">
                            <input type="text" name="mobile" readonly ng-model="pagedata.address.mobile" class="form-control" value="" />
							</div>
                        </div>
                    </div>
                    <div class="form-group" ng-if="pagedata.order.sendtype==1">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
                            配送地址</label>
                        <div class="col-sm-10 col-lg-9">
						    <div class="form-control">
                            {{pagedata.address.pcd.province}}{{pagedata.address.pcd.city}}{{pagedata.address.pcd.district}}{{pagedata.address.address}}
							</div>
					   </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-3 control-label">
                            备注</label>
                        <div class="col-sm-10 col-lg-9">
                            {{pagedata.post.remark}}
                        </div>
                    </div>
                </div>
                <div class="panel-footer">
                    <h5 id="totalprice">订单原总价:<strong class="text-danger">{{pagedata.order.price}}</strong></h5>
					<h5 id="totalprice">多退少补:<strong class="text-danger">{{pagedata.order.addprice || 0}}</strong></h5>
				</div>
            </div>
        </form>
		<button class="btn btn-primary" ng-click="post(pagedata,'post')">提交</button>
    </div>
</div>
<script type="text/javascript">
scope.pagedata.upprice = function(){
		var key=scope.pagedata.nowgoodskey;
		scope.pagedata.nowgoods.newtotalprice=scope.pagedata.nowgoods.total*scope.pagedata.nowgoods.price		
		//if(scope.pagedata.goods[key].total !=scope.pagedata.nowgoods.total){
			scope.pagedata.goods[key].ischange=1;
			scope.pagedata.goods[key].total=scope.pagedata.nowgoods.total;
			scope.pagedata.goods[key].total_price=scope.price(scope.pagedata.nowgoods.newtotalprice)
		//}
		scope.pagedata.order.newtotalprice=0;
		angular.forEach(scope.pagedata.goods,function(cart){
				scope.pagedata.order.newtotalprice+=1*cart.total_price;
		});
		scope.pagedata.order.addprice=scope.pagedata.order.newtotalprice-scope.pagedata.order.total_price;
		scope.pagedata.order.addprice=scope.price(scope.pagedata.order.addprice)
		scope.$evalAsync();
}
scope.pagedata.getgoods=function(){
		if(!scope.pagedata.offcode){
			scope.message('请输入商品称重条码！');
			return false;
		}
		scope.get('jy_weishop/get_data/getgoods/offcode='+scope.pagedata.offcode,function(res){
			if(!res.goods || !res.goods.id){
				scope.msg('没找到该商品！');
				return false;
			}
			scope.addfoot(res.goods.id)
			scope.pagedata.offcode=''
			scope.$evalAsync();
		});
}
 $(function () {
		$(window).off('keydown').keydown(function (k) {
            var $attr = $(k.target);
            if ($attr.attr('name') == "data[auth_code]" || $attr.attr('name') == "data[deduction]" || $attr.attr('name') == "data[mobile]" || $attr.attr('name') == "confirm") {
                //如果是手机号,则模拟点击
                if ($attr.attr('name') == "data[mobile]" && k.keyCode == '13'){
                    k.preventDefault();
                    $("#check_member").trigger('click');
                }
                return;
            }
		});
});
</script>